package com.xinchao.dao;

import com.xinchao.model.Button;
import org.apache.ibatis.annotations.*;

public interface ButtonMapper {
    @Delete({
        "delete from dmp_button",
        "where button_id = #{buttonId,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long buttonId);

    @Insert({
        "insert into dmp_button (button_id, button_name, ",
        "button_desc, add_time, ",
        "update_time, button_type)",
        "values (#{buttonId,jdbcType=BIGINT}, #{buttonName,jdbcType=VARCHAR}, ",
        "#{buttonDesc,jdbcType=VARCHAR}, #{addTime,jdbcType=BIGINT}, ",
        "#{updateTime,jdbcType=BIGINT}, #{buttonType,jdbcType=BIT})"
    })
    int insert(Button record);

    int insertSelective(Button record);

    @Select({
            "select",
            "button_id, button_name, button_desc, add_time, update_time, button_type",
            "from dmp_button",
            "where button_id = #{buttonId,jdbcType=BIGINT}"
    })
    Button selectByPrimaryKey(Long buttonId);

    int updateByPrimaryKeySelective(Button record);

    @Update({
        "update dmp_button",
        "set button_name = #{buttonName,jdbcType=VARCHAR},",
          "button_desc = #{buttonDesc,jdbcType=VARCHAR},",
          "add_time = #{addTime,jdbcType=BIGINT},",
          "update_time = #{updateTime,jdbcType=BIGINT},",
          "button_type = #{buttonType,jdbcType=BIT}",
        "where button_id = #{buttonId,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(Button record);
}